/**
 * @Author DengJia
 * @Date 2021/7/28 22:46
 * @Description
 */

public class AssignmentDemo {
    public static void main(String[] args) {
        //taskSituationA();
        taskSituationB();
    }

    public static void taskSituationA() {
        Task t1 = new Task();
        Task t2 = new Task();

        t1.level = 1;
        t2.level = 2;
        System.out.println("t1.level：" + t1.level + "，t2.level：" + t2.level); // 1 2

        t1 = t2;
        System.out.println("t1.level：" + t1.level + "，t2.level：" + t2.level); // 2 2

        t1.level = 3;
        System.out.println("t1.level：" + t1.level + "，t2.level：" + t2.level); // 3 3
    }

    public static void taskSituationB() {
        Task t1 = new Task();
        Task t2 = new Task();

        t1.level = 1;
        t2.level = 2;
        System.out.println("t1.level：" + t1.level + "，t2.level：" + t2.level); // 1 2

        t1.level = t2.level;
        System.out.println("t1.level：" + t1.level + "，t2.level：" + t2.level); // 2 2

        t1.level = 3;
        System.out.println("t1.level：" + t1.level + "，t2.level：" + t2.level); // 3 2
    }
}

class Task {
    int level;
}
